-- @owner: wang_zhengyuan
-- @date: 2022/02/19
-- @testpoint: 建表覆盖各种数据类型
--step1:建表;expect:建表成功
drop table if exists table_intersect_009 cascade;
 
create table table_intersect_009( 
col_1 bigint, col_2 timestamp without time zone, col_3 bool,col_4 decimal,col_5 clob ,
col_6 interval day to second ,col_7 nchar(30) ,col_8 blob ,col_9 raw(100),col_10 date,
col_11 bytea ,col_12 bytea
) with (storage_type=ustore);
 
--step2:创建序列;expect:创建序列成功
drop sequence if exists v_seq;
 
create sequence v_seq increment by 1 start with 10000;
 
--step3:清空表中数据;expect:清空成功
truncate table table_intersect_009;
 
--step4:插入数据;expect:插入数据成功
begin
  for j in 1..6 loop
    for i in 1..5 loop
      insert into table_intersect_009 values(
      v_seq.nextval,'2019-01-03 14:14:12',true,3.1415926+v_seq.nextval,lpad('abc','5000','a@123&^%djgk')::clob,
      (interval '4 5:12:10.222' day to second(3)),
      'abcasdfghjklke',
      lpad('10',5000,'01010')::blob,rpad('0f',100,'aadb9')::raw,
      '2019-01-03 14:14:12',
      '010101111111100000000000000','010101111111100000000000000'
      );

    end loop;
  end loop;
end;
/
 
--step5:建表;expect:建表成功
drop table if exists table_intersect_010 cascade;
 
create table table_intersect_010( 
col_1 bigint, col_2 timestamp without time zone, col_3 bool,col_4 decimal,col_5 clob ,
col_6 interval day to second ,col_7 nchar(30) ,col_8 blob ,col_9 raw(100),col_10 date,
col_11 bytea ,col_12 bytea
) with (storage_type=ustore);
 
--step6:清空表中数据;expect:清空成功
truncate table table_intersect_010;
 
--step7:插入数据;expect:插入数据成功
begin
  for j in 1..4 loop
    for i in 3..7 loop
      insert into table_intersect_010 values(
      v_seq.nextval,'2019-01-03 14:14:12',true,3.1415926+v_seq.nextval,lpad('abc','5000','a@123&^%djgk')::clob,
      (interval '4 5:12:10.222' day to second(3)),
      'abcasdfghjklke',
      lpad('10',5000,'01010')::blob,rpad('0f',100,'aadb9')::raw,
      '2019-01-03 14:14:12',
      '010101111111100000000000000','010101111111100000000000000'
      );
    end loop;
  end loop;
end;
/
 
